package com.bw.zg2.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.bw.zg2.base.BaseResult
import com.bw.zg2.base.BaseViewModel
import com.bw.zg2.bean.BannerBean
import com.bw.zg2.bean.GoodsTypeBean
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

/**
 *
 * @ClassName: TypeViewModel
 * @Description: java类作用描述
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/21 9:13 AM
 * @Version: 1.0
 */
class TypeViewModel : BaseViewModel() {
    val typeBeanLiveData = MutableLiveData<BaseResult<List<GoodsTypeBean>>>()

    fun getGoodsTypes() {
        viewModelScope.launch(Dispatchers.IO) {
            typeBeanLiveData.postValue(apiService.getGoodsCategory())
        }
    }
}